package com.demo;

import cn.hutool.core.io.FileUtil;
import cn.jpush.spring.boot.EnableJPush;
import cn.jpush.spring.boot.JPushTemplate;
import cn.jpush.spring.boot.PushObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.annotation.PostConstruct;
import java.io.File;
import java.io.IOException;

@EnableJPush
@SpringBootApplication
public class HelloApplication {

	@Autowired
	JPushTemplate template;

	@PostConstruct
	public void test() throws IOException {
		PushObject pushObject = new PushObject();
		pushObject.setMsgContent("mifei test");
		System.out.println(template.sendPush(pushObject));
	}

	public static void main(String[] args) {
		SpringApplication.run(HelloApplication.class, args);
	}

}
